<?php
/**
 * @version		0.2.0 joomla zmluvy $
 * @package		com_zjmluvy
 * @copyright	Copyright © 2011 - All rights reserved.
 * @license		GNU/GPL
 * @author    AdrianKo		
 * @website   http://code.google.com/p/joomla-zmluvy
 *
 *
 *1.3.2012
 */

// no direct access
defined('_JEXEC') or die('Restricted access');?>
<?php  JHTML::_('behavior.tooltip');


	JToolBarHelper::title( JText::_( '&nbsp;&nbsp;&nbsp;'.JText::_( 'title_PARTNERI_EDIT' ) ), 'partneri' );
  //*** treba pridat tlacidlo na JToolBarHelper::save2new();
  JToolBarHelper::save();
	JToolBarHelper::apply();
	if (JRequest::getVar('edit')) {
		JToolBarHelper::cancel( 'cancel', 'Close' );
	} else {
		JToolBarHelper::cancel();
	}
//	JToolBarHelper::help( 'screen.users' );
  //$editor =& JFactory::getEditor();
 $params = JComponentHelper::getParams ('com_jzmluvy');

?>
<form action="index.php" method="post" name="adminForm" enctype="multipart/form-data">
  <div class="col width-60"> 
    <fieldset class="adminform">
      <legend>  
        <?php echo JText::_( 'PA_KONTAKT_INFO' ); ?>
        <?php // 18.10.2011 echo JText::_( 'PA_KONTAKT_INFO' ).$n; ?>
      </legend>
      <table class="admintable">
        <tr>
          <td class="key">
            <label for="title">
              <?php if (($this->item->title) != '') { ?>                            
              <?php echo "<a target='_blank' title='".JText::_( 'PA_FIRMA_LINK' )."' href='http://www.orsr.sk/hladaj_subjekt.asp?OBMENO=".$this->item->title."&amp;PF=0&amp;SID=0&amp;R=on'>".JText::_( 'PA_FIRMA' )."</a>:"; } else {?>
              <?php echo JText::_( 'PA_FIRMA' ).":"; } ?>
            </label></td> 
          <td> 
            <input class="text_area" type="text" name="title" id="title" value="<?php echo $this->item->title; ?>" size="64" maxlength="50" title="<?php echo JText::_( 'PA_FIRMA_INFO' ); ?>"   />
            <?php echo jzmluvyHelper::obrazok('povinne-16.png','',JText::_( 'fa_POVINNE' )) ?>
            </td>
        </tr>
        <tr> 
          <td class="key"> 
            <label for="or_vlozka">
              <?php if (($this->item->or_vlozka) != 0) { ?>
              <?php echo "<a target='_blank' title='".JText::_( 'PA_OBCHODNY_REGISTER_LINK' )."' href='http://www.orsr.sk/hladaj_spiszn.asp?VLOZKA=".$this->item->or_vlozka."&amp;ODD=".$this->item->or_odd."&amp;SID=".$this->item->or_sud."'>".JText::_( 'PA_OBCHODNY_REGISTER' )."</a>:"; } else {?>
              <?php echo JText::_( 'PA_OBCHODNY_REGISTER' ),":"; } ?>
            </label></td> 
          <td> 
            <input id="or_vlozka" class="text_area" name="or_vlozka" title="<?php echo JText::_( 'PA_OR_VLOZKA_INFO' ); ?>" value="<?php echo $this->item->or_vlozka; ?>" size="10" maxlength="10" />
            <?php echo $this->lists['orr_sud']; ?>
            <?php echo $this->lists['orr_odd']; ?></td>
        </tr>
        <tr> 
          <td class="key"> 
            <label for="meno"><?php echo JText::_( 'PA_MENO' ); ?>:
            </label></td> 
          <td> 
            <input class="text_area" type="text" name="meno" id="meno" value="<?php echo $this->item->meno; ?>" size="50" maxlength="50" title="<?php echo JText::_( 'PA_MENO_INFO' ); ?>" /></td>
        </tr>
        <tr> 
          <td class="key"> 
            <label for="ico"><?php echo JText::_( 'PA_ICO' ); ?>:
            </label></td> 
          <td>
            <input class="text_area" type="text" name="ico" id="ico" value="<?php echo $this->item->ico; ?>" size="50" maxlength="50" title="<?php echo JText::_( 'PA_ICO_INFO' ); ?>" />
            <?php // echo jzmluvyHelper::obrazok('povinne-16.png','',JText::_( 'fa_POVINNE' )) ?>
            </td>
            </tr>
        <?php if($this->nastavenie->partner_dic) : ?>
        <tr> 
          <td class="key"> 
            <label for="dic">
              <?php echo JText::_( 'PA_DIC' ); ?>:
            </label></td> 
          <td> 
            <input class="text_area" type="text" name="dic" id="dic" value="<?php echo $this->item->dic; ?>" size="50" maxlength="50" title="<?php echo JText::_( 'PA_DIC_INFO' ); ?>" /></td>
        </tr>
        <?php endif; ?>
        
        <?php 
         if ((($this->pocet(0) >= $this->nastavenie->partner_pocet_obj) && ($this->item->typ == '')) || (($this->pocet(0) >= $this->nastavenie->partner_pocet_obj) && ($this->item->typ != 0)))  {} else { ?>
        <tr> 
          <td class="key"> 
            <label>
              <?php echo JText::_( 'PA_TYP' ); ?>
            </label></td> 
          <td> 
							<?php echo $this->lists['typ']; ?>  <!-- prerobit na checkbox --> </td>
        </tr>
        <?php } ?>
        
        <tr> 
          <td class="key"> 
            <label><?php echo JText::_( 'PA_ZVEREJNIT' ); ?>
            </label></td> 
          <td>
            <?php echo $this->lists['published']; ?></td>
        </tr>
        <tr> 
          <td class="key"> 
            <label><img src="images/bookmark_f2.png" border="0" alt="+" width="16" height="16" /><?php echo "  ".JText::_( 'FAVORIT' ); ?>
            </label></td> 
          <td>
            <?php echo $this->lists['favorit']; ?></td>
        </tr>        
      </table>
    </fieldset>
    <fieldset class="adminform">
      <legend>
        <?php echo JText::_( 'PA_ADRESA' ); ?>
      </legend>
      <table class="admintable">
        <tr> 
          <td class="key"> 
            <label for="ulica">
              <?php echo JText::_( 'PA_ULICA' ); ?>:
            </label></td> 
          <td>
            <input class="text_area" type="text" name="ulica" id="ulica" value="<?php echo $this->item->ulica; ?>" size="50" maxlength="50" title="<?php echo JText::_( 'PA_ULICA_INFO' ); ?>" />
            <?php echo jzmluvyHelper::obrazok('povinne-16.png','',JText::_( 'fa_POVINNE' )) ?>
            </td>
        </tr>
        <tr> 
          <td class="key"> 
            <label for="mesto">
              <?php echo JText::_( 'PA_MESTO' ); ?>:
            </label></td> 
          <td> 
            <input class="text_area" type="text" name="mesto" id="mesto" value="<?php echo $this->item->mesto; ?>" size="50" maxlength="50" title="<?php echo JText::_( 'PA_MESTO_INFO' ); ?>" />
            <?php echo jzmluvyHelper::obrazok('povinne-16.png','',JText::_( 'fa_POVINNE' )) ?>
            </td>
        </tr>
        <tr> 
          <td class="key"> 
            <label for="psc">
              <?php echo JText::_( 'PA_PSC' ); ?>:
            </label></td> 
          <td> 
            <input class="text_area" type="text" name="psc" id="psc" value="<?php echo $this->item->psc; ?>" size="50" maxlength="6" title="<?php echo JText::_( 'PA_PSC_INFO' ); ?>" />
            <?php echo jzmluvyHelper::obrazok('povinne-16.png','',JText::_( 'fa_POVINNE' )) ?>
            </td>
        </tr>
        <tr> 
          <td class="key"> 
            <label for="stat">
              <?php echo JText::_( 'PA_STAT' ); ?>:
            </label></td> 
          <td>
            <input class="text_area" type="text" name="stat" id="stat" value="<?php echo $this->item->stat; ?>" size="50" maxlength="50" title="<?php echo JText::_( 'PA_STAT_INFO' ); ?>" />
            <?php echo jzmluvyHelper::obrazok('povinne-16.png','',JText::_( 'fa_POVINNE' )) ?>
            </td>
        </tr>
      </table>
    </fieldset>
    
    <fieldset class="adminform">
      <legend>
        <?php echo JText::_( 'PA_OSTATNE' ); ?>
      </legend>
      <table class="admintable">
        <tr> 
          <td  class="key" valign="top"> 
            <label for="description">
              <?php echo JText::_( 'PA_POZNAMKY' ); ?>:
            </label></td> <td> 
<textarea name="description" id="description" rows="5" cols="45" class="inputbox"><?php echo $this->item->description; ?></textarea></td>
        </tr>
        <?php if($this->nastavenie->partner_logo) : ?>
        <tr> 
          <td valign="top" class="key"> 
            <label for="logo">
              <?php echo JText::_( 'PA_LOGO' ); ?>:
            </label></td> 
          <td >
            <?php echo $this->lists['logo']  ;?></td>
        </tr>
        <tr> 
          <td valign="top" class="key">
          <label for="logo_view">
            <?php echo JText::_( 'PA_LOGO_UKAZKA' ); ?>:</label></td> 
          <td valign="top">
                     
<?php $fullpath = JURI::root().'media/com_jzmluvy/logo/';
 
            if  (preg_match("/gif|jpg|png/i", $this->item->logo)) {
                        ?>       
            <img  src="<?php echo $fullpath,$this->item->logo; ?>" alt="blank" name="imagelib" />             
<?php
                  } else {
                        ?> 
            <img src="../images/blank.png" name="imagelib" id="logo_bez" alt="blank" />            
<?php
            }
                        ?></td>
        </tr><?php endif ?>
      </table>
    </fieldset>
  </div>
  <div class="clr">
  </div> 
  <input type="hidden" name="option" value="com_jzmluvy" /> 
  <input type="hidden" name="controller" value="upravapartner" /> 
  <input type="hidden" name="id" value="<?php echo $this->item->id; ?>" /> 
  <input type="hidden" name="task" value="" /> 
  <input type="hidden" name="redirect" value="<?php //echo $redirect; ?>" />
  <?php echo JHTML::_( 'form.token' ); ?>
</form>